package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Account  string
	Password string
}

func (u *User) Create() error {
	return DB.Create(&u).Error
}

func (u *User) GetUserByAccount() error {
	return DB.Where("account=?", u.Account).Limit(1).Find(&u).Error
}
